package com.example.property.entity

import com.blankj.utilcode.util.GsonUtils
import com.example.network.BaseResponse
import org.json.JSONArray

data class CarColorResultEntity(
    val msg: String,
    val statuesCode: String,
    val values: String,
):BaseResponse(){
    fun getValues():List<CarColorValues>{
        var list = mutableListOf<CarColorValues>()
        var jsonArray = JSONArray(values)
        for (i in 0  until  jsonArray.length()) {
            list.add(GsonUtils.fromJson(jsonArray[i].toString(), CarColorValues::class.java))
        }
        return list
    }
}

data class CarColorValues(
    val colorId : Int,
    val colorValue:String,
)